from entity import TreeNode


def make_tree(arr):
    if not arr:
        return None
    mid = len(arr) // 2
    root = TreeNode(arr[mid])
    root.left = make_tree(arr[:mid])
    root.right = make_tree(arr[mid + 1:])
    return root


arr1 = [1, 2, 3, 4, 5, 6]
ans = make_tree(arr1)
print(ans)
